From: Johan Bockgard Date: Thu, 15 Sep 2011 16:02:49 +0000 (+0300) Subject: Fix bug #9495 with cursor positioning on truncated lines. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~2260 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=32d223f373c3d5375e13951138114145529654b4;p=emacs.git Fix bug #9495 with cursor positioning on truncated lines. Patch by Johan Bockgוrd src/xdisp.c (try_cursor_movement): Only check for exact match if cursor hpos found by set_cursor_from_row is valid. (Bug#9495) --- diff --git a/src/ChangeLog b/src/ChangeLog index 18bffcda3e0..a5296d1a5f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-09-15 Johan BockgÃ¥rd + + * xdisp.c (try_cursor_movement): Only check for exact match if + cursor hpos found by set_cursor_from_row is valid. (Bug#9495) + 2011-09-14 Paul Eggert Remove unused external symbols. diff --git a/src/xdisp.c b/src/xdisp.c index 1ccaa0641b0..0f842b8673e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14627,7 +14627,10 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste is set, we are done. */ at_zv_p = MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p; - if (!at_zv_p) + if (rv && !at_zv_p + && w->cursor.hpos >= 0 + && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix, + w->cursor.vpos)) { struct glyph_row *candidate = MATRIX_ROW (w->current_matrix, w->cursor.vpos);